<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>会员列表-WeAdmin Frame型后台管理系统-WeAdmin 1.0</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<link rel="stylesheet" href="../../static/css/font.css">
		<link rel="stylesheet" href="../../static/css/weadmin.css">
		<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
		<!--[if lt IE 9]>
	      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
	      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
	    <![endif]-->
	</head>

	<body>
		<div class="weadmin-nav">
			<span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">日志管理</a>
        <a>
          <cite>系统日志</cite></a>
      </span>
			<a class="layui-btn layui-btn-sm" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
				<i class="layui-icon" style="line-height:30px">&#x1002;</i></a>
		</div>
		<div class="weadmin-body">
			<table class="layui-table" id="systemlog">
			</table>
			</div>
		</div>

		<script src="../../lib/layui/layui.js" charset="utf-8"></script>
		<script src="../../static/js/date-format.js" type="text/javascript" charset="utf-8"></script>

		<script>
			isFirst = true;	//第一次请求系统日志

			layui.extend({
				admin: '{/}../../static/js/admin'
			});

			layui.use(['laydate','jquery','admin','table', 'form'], function() {
				var laydate = layui.laydate,
					$ = layui.jquery,
					admin = layui.admin,
					table = layui.table,
					form = layui.form;

				// form.on('submit(search)', function(data){
					table.render({
						elem: '#systemlog',
						where: {isFirst: isFirst},
						url: 'WebSystemLog.Lq', //数据接口
						page: true,
						even: true, //隔行背景
						cols: [[
							{field:'EventID', title: '事件Id', width:80, sort: true},
							{field:'EntryType', title: '级别', width:160, sort: true},
							{field:'Source', title: '来源', sort: true},
							{field:'TimeWritten', title: '记录时间', width:160, sort: true, templet:'<div>{{TimeFormat(d.TimeWritten)}}</div>'},
							{field:'UserName', title: '用户', width:160, sort: true},
							{field:'MachineName', title: '计算机名', width:160, sort: true},
							{field:'Message', title: '消息', sort: true},
						]],
					});

					isFirst = false;
				// 	return false;
				// });
			});

			function DateFormat(d){
				var date = new Date(d);
				return date.Format("yyyy-MM-dd");
			}

			function TimeFormat(d) {
				var date = new Date(d);
				var min = new Date("0001-01-01T00:00:00");
				return date.getTime() == min.getTime() ? "" : date.Format("yyyy-MM-dd hh:mm:ss");
			}
		</script>
	</body>

</html>